<template>
  <div>
    <back title="table组件"></back>
    <xr-table :columns="columns" :data="data"></xr-table>
  </div>
</template>
<script>
import XrTable from '@/components/Table';
export default {
  components: {
    XrTable
  },
  data() {
    return {
      columns: [
        {
          type: 'selection' // 这个地方可以不用写 key，type 就相当于 key
        },
        {
          type: 'expand'
        },
        {
          title: '姓名',
          key: 'name',
          width:'200'
        },
        {
          title: '年龄',
          key: 'age',
          width:'200',
          sortable: true
        },
        {
          title: '职位',
          key: 'job'
        }
      ],
      data: [
        {
          id: 1,
          name: 'color1',
          age: 18,
          job: '产品',
          desc: '这是展开的描述啊1'
        },
        {
          id: 2,
          name: 'color2',
          age: 18,
          job: '设计',
          desc: ''
        },
        {
          id: 3,
          name: 'color3',
          age: 24,
          job: '前端',
          desc: '这是展开的描述啊3'
        },
        {
          id: 4,
          name: 'color4',
          age: 30,
          job: '后端',
          desc: '这是展开的描述啊4'
        },
        {
          id: 5,
          name: 'color5',
          age: 18,
          job: '测试',
          desc: '这是展开的描述啊5'
        }
      ]
    };
  },
  methods:{
    
  }
};
</script>